<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>Form Layouts</title>

    <link href="<%=path%>/resources/css/style.css" rel="stylesheet">
    <link href="<%=path%>/resources/css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="<%=path%>/resources/js/html5shiv.js"></script>
    <script src="<%=path%>/resources/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <%@ include file="/page/common/leftmenu.jsp" %>
    <!-- left side end-->

    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <%@ include file="/page/common/top.jsp" %>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading">
            <h3>

            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">管理平台</a>
                </li>
                <li class="active">用户意见反馈</li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <section class="wrapper">
            <!-- page start-->
            <div class="table table-striped table-hover table-bordered" id="editable-sample">
                <div class="table-responsive" data-pattern="priority-columns" data-focus-btn-icon="fa-asterisk"
                     data-sticky-table-header="true" data-add-display-all-btn="true" data-add-focus-btn="true">
                    <table id="table" data-unique-id="id"
                           data-pagination="true"
                           data-id-field="id"
                           data-maintain-selected="true"
                           data-page-size="10"
                           data-page-list="[5,10,15,20]"
                           data-side-pagination="server">
                    </table>
                </div>
            </div>
            <!-- page end-->
        </section>


        <!--body wrapper end-->

        <!--footer section start-->
        <%@ include file="/page/common/footer.jsp" %>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="<%=path%>/resources/js/jquery-1.10.2.min.js"></script>
<script src="<%=path%>/resources/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="<%=path%>/resources/js/jquery-migrate-1.2.1.min.js"></script>
<script src="<%=path%>/resources/js/bootstrap.min.js"></script>
<script src="<%=path%>/resources/js/bootstrap.min.js"></script>
<script src="<%=path%>/resources/js/bootstrap-table.js"></script>

<script src="<%=path%>/resources/js/modernizr.min.js"></script>
<script src="<%=path%>/resources/js/jquery.nicescroll.js"></script>
<script src="<%=path%>/resources/js/common.js"></script>

<!--common scripts for all pages-->
<script src="<%=path%>/resources/js/scripts.js"></script>
<script>
    var offset = -1;
    var $table = $('#table'), selections = [];
    $(function () {
        initData();
    });

    /*初始化表格数据*/
    function initData() {
        $('#table').bootstrapTable({
            url: "<%=request.getContextPath() %>/admin/cust/queryCustomerSuggest.do",
            //clickToSelect: 'true',//选中一行
            queryParams: queryParams,
            formatLoadingMessage: function () {
                return "请稍等，正在加载中...";
            },
            formatNoMatches: function () {  //没有匹配的结果
                return '无符合条件的记录';
            },
            columns: [{
                field: 'SerialNumber',
                title: '序号',
                width: '80',
                align: 'center',
                formatter: function (value, row, index) {
                    return index+1;
                }
            }, {
                field: 'logo',
                title: '微信头像',
                width: '150',
                align: 'center',
                formatter: 'logoFormatter',
            }, {
                field: 'phone',
                title: '用户名',
                width: '150',
                align: 'center',
            }, {
                field: 'wName',
                title: '微信号',
                width: '150',
                align: 'center',
            }, {
                field: 'message',
                title: '反馈内容',
                width: '350',
                align: 'center',
            }, {
                field: 'crtTime',
                title: '反馈时间',
                width: '150',
                align: 'center',
            }],
        });
    }

    /*刷新*/
    function search() {
        offset = 0;
        $table.bootstrapTable('refresh');
    }

    /**封装查询条件**/
    function queryParams(params) {
        if (offset == 0) {
            params.offset = offset;
        }
        offset = -1;
        var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            limit: params.limit,  //页面大小
            offset: params.offset, //页码
            maxrows: params.limit,
            pageindex: params.pageNumber
        };
        return temp;
    }

    function logoFormatter(value){
        var context="<img width='100px' height='30px' src='" + value + "'>"
        return context;
    }

    jQuery(document).ready(function($)
    {
        selectEffect("admin/cust/customer_suggest_page.do");
    });
</script>
</body>
</html>

